/*
 * Created by JFormDesigner on Wed May 19 10:36:37 CST 2021
 */

package renthouse.view.mainManger;

import renthouse.view.information.landlordmanger.houseManger.AddHouse;
import renthouse.view.information.landlordmanger.houseManger.HouseInFo;
import renthouse.view.information.landlordmanger.orderManger.LandlordFindOrder;
import renthouse.view.information.landlordmanger.userManger.LanlordFindUser;

import java.awt.*;
import javax.swing.*;

/**
 * @author Brainrain
 * 房东主界面
 */
public class LandlordFrame extends JFrame {
    public static LandlordFrame landlordFrame=null;
    public LandlordFrame() {
        initComponents();
    }

    private void queryHouseActionPerformed() {
        // TODO add your code here

        HouseInFo houseInFo=new HouseInFo();
        houseInFo.setVisible(true);
    }

    private void menuItem5ActionPerformed() {
        // TODO add your code here

        LandlordFindOrder landlordFindOrder=new LandlordFindOrder();
        landlordFindOrder.setVisible(true);
    }

    private void menuItem6ActionPerformed() {
        // TODO add your code here

        LanlordFindUser lanlordFindUser=new LanlordFindUser();
        lanlordFindUser.setVisible(true);
    }

    private void insertHouseActionPerformed() {
        // TODO add your code here
        AddHouse addHouse=new AddHouse();
        addHouse.setVisible(true);
    }

    private void updateHouseActionPerformed() {
        // TODO add your code here
        HouseInFo houseInFo=new HouseInFo();
        houseInFo.setVisible(true);
    }

    private void deleteHouseActionPerformed() {
        // TODO add your code here
        HouseInFo houseInFo=new HouseInFo();
        houseInFo.setVisible(true);
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        menuBar1 = new JMenuBar();
        menu1 = new JMenu();
        queryHouse = new JMenuItem();
        insertHouse = new JMenuItem();
        updateHouse = new JMenuItem();
        deleteHouse = new JMenuItem();
        menu2 = new JMenu();
        menuItem5 = new JMenuItem();
        menu3 = new JMenu();
        menuItem6 = new JMenuItem();
        panel1 = new JPanel();
        label1 = new JLabel();

        //======== this ========
        setTitle("\u623f\u4e1c\u754c\u9762");
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //======== menuBar1 ========
        {

            //======== menu1 ========
            {
                menu1.setText("\u623f\u5c4b\u7ba1\u7406");

                //---- queryHouse ----
                queryHouse.setText("\u67e5\u8be2\u6211\u7684\u623f\u5c4b");
                queryHouse.addActionListener(e -> queryHouseActionPerformed());
                menu1.add(queryHouse);

                //---- insertHouse ----
                insertHouse.setText("\u6dfb\u52a0\u51fa\u79df\u623f\u5c4b");
                insertHouse.addActionListener(e -> insertHouseActionPerformed());
                menu1.add(insertHouse);

                //---- updateHouse ----
                updateHouse.setText("\u4fee\u6539\u51fa\u79df\u623f\u5c4b");
                updateHouse.addActionListener(e -> updateHouseActionPerformed());
                menu1.add(updateHouse);

                //---- deleteHouse ----
                deleteHouse.setText("\u5220\u9664\u51fa\u79df\u623f\u5c4b");
                deleteHouse.addActionListener(e -> deleteHouseActionPerformed());
                menu1.add(deleteHouse);
            }
            menuBar1.add(menu1);

            //======== menu2 ========
            {
                menu2.setText("\u6211\u7684\u8ba2\u5355");

                //---- menuItem5 ----
                menuItem5.setText("\u67e5\u770b\u8ba2\u5355");
                menuItem5.addActionListener(e -> menuItem5ActionPerformed());
                menu2.add(menuItem5);
            }
            menuBar1.add(menu2);

            //======== menu3 ========
            {
                menu3.setText("\u623f\u5ba2\u7ba1\u7406");

                //---- menuItem6 ----
                menuItem6.setText("\u67e5\u770b\u623f\u5ba2");
                menuItem6.addActionListener(e -> menuItem6ActionPerformed());
                menu3.add(menuItem6);
            }
            menuBar1.add(menu3);
        }
        setJMenuBar(menuBar1);

        //======== panel1 ========
        {
            panel1.setLayout(null);

            //---- label1 ----
            label1.setText("\u623f\u4e1c\u7ba1\u7406\u7cfb\u7edf");
            label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 15f));
            panel1.add(label1);
            label1.setBounds(35, 50, 200, 45);

            { // compute preferred size
                Dimension preferredSize = new Dimension();
                for(int i = 0; i < panel1.getComponentCount(); i++) {
                    Rectangle bounds = panel1.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = panel1.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                panel1.setMinimumSize(preferredSize);
                panel1.setPreferredSize(preferredSize);
            }
        }
        contentPane.add(panel1);
        panel1.setBounds(65, 45, 280, 135);

        { // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JMenuBar menuBar1;
    private JMenu menu1;
    private JMenuItem queryHouse;
    private JMenuItem insertHouse;
    private JMenuItem updateHouse;
    private JMenuItem deleteHouse;
    private JMenu menu2;
    private JMenuItem menuItem5;
    private JMenu menu3;
    private JMenuItem menuItem6;
    private JPanel panel1;
    private JLabel label1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
